<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/7/19
  Time: 9:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <!-- 引入Bootstrap CSS -->
    <link rel="stylesheet" href="./static/css/bootstrap.min.css">
    <!-- 自定义样式 -->
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
        }

        .login-card {
            width: 400px;
            padding: 20px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            background-color: white;
        }

        .login-card h4 {
            text-align: center;
            margin-bottom: 20px;
        }

        .login-card .form-control {
            margin-bottom: 10px;
        }

        .login-card button {
            width: 100%;
        }
    </style>
</head>
<body>
<div class="login-card">
    <h4>aaa-chat-admin登录</h4>
    <form action="user?request_type=login" method="post">
        <div class="mb-3">
            <label for="username" class="form-label">用户名</label>
            <input type="text" class="form-control" id="username" value="张三" required name="user_name" placeholder="请输入你的用户名">
        </div>
        <div class="mb-3">
            <label for="password" class="form-label">密码</label>
            <input type="password" class="form-control" id="password" value="123456" required name="password" placeholder="请输入你的密码">
        </div>
        <div class="mb-3">
            <label for="captcha" class="form-label">验证码</label>
            <div class="d-flex align-items-center">
                <input type="text" class="form-control me-2" id="captcha" value="111111" required name="captcha" placeholder="请输入下方验证码">
<%--                <span style="color: red">${message}</span>--%>
                <img src="api/getCaptchaImage" alt="Captcha Image" style="width: 100px; cursor: pointer;"
                     onclick="this.src='api/getCaptchaImage?'+Math.random();">
                <span style="color: red">
                   ${message}
                </span>
            </div>
        </div>
        <button type="submit" class="btn btn-primary">登录</button>
    </form>
</div>
<script>
    //防止在iframe里嵌套显示登录界面
    if(window !=top){
        top.location.href=location.href;
    }
</script>
<!-- 引入Bootstrap JS -->
<script src="./static/js/jquery.min.js"></script>
<script src="./static/js/bootstrap.min.js"></script>
</body>
</html>
